package com.kintreda.ieco_server.bean.system;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import com.kintreda.ieco_server.util.DateUtil;

import org.hibernate.annotations.GenericGenerator;

/**
 * 实体公共继承属性
 * @author HuangZhongYao
 *
 */
@MappedSuperclass
public class BaseVo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "uuid.hex")
	@Column(name = "id", unique = true, nullable = true)
	private String id;
	@Column(name="createDate")
	private String createDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
	@Column(name="updateDate")
	private String updateDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
	@Column(name="status")
	private String status;
	
	//开始时间
	@Transient
	private String beginDate;
	//截至时间
	@Transient
	private String endDate;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCreateDate() {
		return createDate;
	}
	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}
	public String getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(String updateDate) {
		this.updateDate = updateDate;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	
	public String getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(String beginDate) {
		this.beginDate = beginDate;
	}
	public String getEndDate() {
		return endDate;
	}
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	
	public void init() {
		this.createDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
		this.updateDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
		this.status = "0";
	}
	
	public void initDate() {
		this.createDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
		this.updateDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
	}
	
	public void initOne() {
		this.createDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
		this.updateDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
		this.status = "1";
	}
}
